Skip to content

refactor(accounts): move account crud into the accounts store#3036

Open
afonsojramos wants to merge 2 commits into
mainfrom
refactor/accounts-store-crud
Open

refactor(accounts): move account crud into the accounts store#3036
afonsojramos wants to merge 2 commits into
mainfrom
refactor/accounts-store-crud

Conversation

@afonsojramos

Copy link
Copy Markdown
Member

Summary

Split from #3034. The accounts store now owns account CRUD:

  • The AuthState-shaped helpers in utils/auth/utils.ts (addAccount, removeAccount, hasAccounts, hasMultipleAccounts, getPrimaryAccountHostname) are inlined into useAccountsStore actions, and the AuthState type is deleted.
  • utils/auth/utils.ts keeps only account-scoped utilities (refreshAccount, getAccountUUID, isValidHostname).
  • Account-creation test coverage (Cloud + Enterprise, PAT + OAuth, re-auth upsert) moved from auth/utils.test.ts into useAccountsStore.test.ts, plus new primaryAccountHostname coverage.

Notes

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactoring of existing feature

Development

Successfully merging this pull request may close these issues.

1 participant